package com.toycloud.system.mapper.feedback;

import com.toycloud.business.dto.params.FeedbackConfigPNameParams;
import com.toycloud.business.dto.params.FeedbackConfigTypeParams;
import com.toycloud.system.domain.feedback.FeedbackConfig;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author hlchan
 * @description 针对表【feedback_config】的数据库操作Mapper
 * @createDate 2024-09-04 17:47:05
 * @Entity com.toycloud.system.domain.feedback.FeedbackConfig
 */
@Repository
public interface FeedbackConfigMapper {

    int deleteByPrimaryKey(Long id);

    int insert(FeedbackConfig record);

    int insertSelective(FeedbackConfig record);

    @Select("select * from feedback_config where type=#{type} and name=#{name} and pid=#{pid} and weight=#{weight} and alias=#{alias} limit 1")
    FeedbackConfig selectByTypeAndName(@Param("type") int type, @Param("name") String name ,@Param("pid") Integer pid,@Param("weight") Double weight,@Param("alias") String alias );


    List<FeedbackConfig> selectByPNameAndName(FeedbackConfigPNameParams params);

    List<FeedbackConfig> selectByPNameAndNameAndPid(FeedbackConfigPNameParams params);

    List<FeedbackConfig> selectOwnProduct(FeedbackConfigPNameParams params);

    List<FeedbackConfig> selectSelective(FeedbackConfigPNameParams params);

    List<FeedbackConfig> selectByType(FeedbackConfigTypeParams params);

    @Select("select * from feedback_config where pid=#{pid} ")
    List<FeedbackConfig> selectByPid(@Param("pid") int pid);

    FeedbackConfig selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(FeedbackConfig record);

    int updateByPrimaryKey(FeedbackConfig record);

    List<FeedbackConfig> selectByIds(@Param("ids") String[] ids);

    List<FeedbackConfig> selectByTypeValue(int type);

    List<FeedbackConfig> selectByTypeValueAndPid(@Param("type") int type, @Param("pid") Integer pid);

    int deleteByPid(@Param("pid") int pid);

    List<FeedbackConfig> selectByFlag(@Param("flag") int flag);

    List<FeedbackConfig> selectByTypes(@Param("types") String[] types);

    List<FeedbackConfig> selectByTypeAndLikeName(@Param("type") int type, @Param("name") String name);

    List<FeedbackConfig> selectByTypeAndLikeSecondLevelLabel(@Param("type") int type, @Param("name") String name);

    List<FeedbackConfig> selectByTypeAndLikeFirstLevelLabel(@Param("type") int type, @Param("name") String name);
}
